package com.foreknow.demo5Exercise3;

import java.util.ArrayList;
import java.util.List;

/**
 * 总订单类
 * 订单编号
 * 订单总额
 * 订单项  OrderItem[]
 */
public class Order {

    private OrderItem[] dd;
    OrderItem o = new OrderItem();

    public Order() {
        dd = new OrderItem[3];
    }

    int count;

    //将购买的订单添加进订单项数组中
    public void add(OrderItem oi) {
        if (count<3) {
            dd[count] = oi;
        }
    }

    //将订单信息输出
    public void show() {
        double money = o.money();
        System.out.println("订单的总额为" + money);

    }

    public static void main(String[] args) {
        List<OrderItem> list = new ArrayList();
        OrderItem oi1 = new OrderItem();
        OrderItem oi2 = new OrderItem();
        OrderItem oi3 = new OrderItem();
        list.add(oi1);
        list.add(oi2);
        list.add(oi3);



    }

}
